﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Entities.PBCM;

using WindowsForms.PBCM.usercontrol;

namespace WindowsForms.PBCM
{
    public partial class FormPhoBanChuyenMon : Form
    {
        public List<ThietBi> tam;
        int thu=0;
        public DieuLeVaHinhThucThiDau dlht;
        public FormPhoBanChuyenMon()
        {
            InitializeComponent();
        }

        private void AutoUpdateDepartments()
        {
            DataTable dt = new DataTable();
        }

        private void buttonTrangThietBi_Click(object sender, EventArgs e)
        {
            thu = 1;
            panelRight.Controls.Clear();
            UCThietBi dl = new UCThietBi();
            dl.Dock = System.Windows.Forms.DockStyle.Fill;
            panelRight.Controls.Add(dl);
            
        }

        private void buttonDieuLeVaHinhThuc_Click(object sender, EventArgs e)
        {
            thu=2;
       
            panelRight.Controls.Clear();
            UCDieuLe dl = new UCDieuLe();
            dl.Dock = System.Windows.Forms.DockStyle.Fill;
            panelRight.Controls.Add(dl);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            thu = 3;

            panelRight.Controls.Clear();
            UCChiTietThietBi dl = new UCChiTietThietBi();
            dl.Dock = System.Windows.Forms.DockStyle.Fill;
            panelRight.Controls.Add(dl);
        }

        private void buttonThem_Click(object sender, EventArgs e)
        {
            if(thu==1)
            {
                FormThemThietTbi da = new FormThemThietTbi();
                da.ShowDialog();
            }
            if (thu == 2)
            {
                FormThemDieuLeVaHinhThuc da = new FormThemDieuLeVaHinhThuc();
                da.ShowDialog();
            }
            if (thu == 3)
            {
                FormThemChiTietThietBi da = new FormThemChiTietThietBi();
                da.ShowDialog();
            }
        }

        private void buttonLamMoi_Click(object sender, EventArgs e)
        {
            if (thu == 1)
            {
                thu = 1;
                panelRight.Controls.Clear();
                UCThietBi dl = new UCThietBi();
                dl.Dock = System.Windows.Forms.DockStyle.Fill;
                panelRight.Controls.Add(dl);
            }
            if (thu == 2)
            {
                thu = 2;
                panelRight.Controls.Clear();
                UCDieuLe dl = new UCDieuLe();
                dl.Dock = System.Windows.Forms.DockStyle.Fill;
                panelRight.Controls.Add(dl);
            }
            if (thu == 3)
            {
                thu = 3;
                panelRight.Controls.Clear();
                UCChiTietThietBi dl = new UCChiTietThietBi();
                dl.Dock = System.Windows.Forms.DockStyle.Fill;
                panelRight.Controls.Add(dl);
            }
        }

       

        private void buttonItemTrangThietBi_Click(object sender, EventArgs e)
        {
            thu = 1;
        
            panelRight.Controls.Clear();
            UCThietBi dl = new UCThietBi();
            dl.Dock = System.Windows.Forms.DockStyle.Fill;
            panelRight.Controls.Add(dl);
        }

        private void buttonItemChiTietThietBi_Click(object sender, EventArgs e)
        {
            thu = 3;
  
            panelRight.Controls.Clear();
            UCChiTietThietBi dl = new UCChiTietThietBi();
            dl.Dock = System.Windows.Forms.DockStyle.Fill;
            panelRight.Controls.Add(dl);
        }

        private void buttonItemDieuLeVaHinhThuc_Click(object sender, EventArgs e)
        {
            thu = 2;
            panelRight.Controls.Clear();
            UCDieuLe dl = new UCDieuLe();
            dl.Dock = System.Windows.Forms.DockStyle.Fill;
            panelRight.Controls.Add(dl);
        }

        private void buttonItemLamMoi_Click(object sender, EventArgs e)
        {
            if (thu == 1)
            {
                thu = 1;
                panelRight.Controls.Clear();
                UCThietBi dl = new UCThietBi();
                dl.Dock = System.Windows.Forms.DockStyle.Fill;
                panelRight.Controls.Add(dl);
            }
            if (thu == 2)
            {
                thu = 2;
                panelRight.Controls.Clear();
                UCDieuLe dl = new UCDieuLe();
                dl.Dock = System.Windows.Forms.DockStyle.Fill;
                panelRight.Controls.Add(dl);
            }
            if (thu == 3)
            {
                thu = 3;
                panelRight.Controls.Clear();
                UCChiTietThietBi dl = new UCChiTietThietBi();
                dl.Dock = System.Windows.Forms.DockStyle.Fill;
                panelRight.Controls.Add(dl);
            }
        }

        private void buttonItemThem_Click(object sender, EventArgs e)
        {
            if (thu == 1)
            {
                FormThemThietTbi da = new FormThemThietTbi();
                da.ShowDialog();
            }
            if (thu == 2)
            {
                FormThemDieuLeVaHinhThuc da = new FormThemDieuLeVaHinhThuc();
                da.ShowDialog();
            }
            if (thu == 3)
            {
                FormThemChiTietThietBi da = new FormThemChiTietThietBi();
                da.ShowDialog();
            }
        }

           


       
    }
}
